"""
通过UDP协议给接收者发送一个图片
1、UDP的socket套接字
2、基于网络传输的数据都是二进制数据
"""
import socket
sender = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# 获取到图片的字节数据
with open("C:\\Users\\11018\\Desktop\\a.txt","rb") as f:
    result = f.read()
    sender.sendto(result,("127.0.0.1",40000))
    print("发送成功")
    sender.close()